//
//  DENFindDetailTableViewCell.m
//  Icar
//
//  Created by apple on 15/10/19.
//  Copyright © 2015年 小龙侠. All rights reserved.
//

#import "DENFindDetailTableViewCell.h"

@implementation DENFindDetailTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
       [self creatControl];
    }
    return self;
}
- (void)creatControl
{
//    图片
    self.photoImageView = [[UIImageView alloc]initWithFrame:CGRectMake(WIDTH(18), HEIGHT(5), WIDTH(85), HEIGHT(55))];
    [self.contentView addSubview:self.photoImageView];
//    车名
    self.carName = [[UILabel alloc]initWithFrame:CGRectMake(WIDTH(110), HEIGHT(5), WIDTH(200), HEIGHT(18))];
    self.carName.font = [UIFont boldSystemFontOfSize:16];
    [self.contentView addSubview:self.carName];
    
//    价格范围
    self.priceRange = [[UILabel alloc]initWithFrame:CGRectMake(WIDTH(110), HEIGHT(27), WIDTH(200), HEIGHT(15))];
    self.priceRange.textColor = [UIColor redColor];
    self.priceRange.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:self.priceRange];
    
//    种类
    self.kind = [[UILabel alloc]initWithFrame:CGRectMake(WIDTH(110), HEIGHT(44), WIDTH(200), HEIGHT(15))];
    self.kind.textColor = [UIColor grayColor];
    self.kind.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:self.kind];
}
- (void)setFindModel:(DENFindModel *)findModel
{
    NSURL *url = [NSURL URLWithString:findModel.photo];
    [self.photoImageView sd_setImageWithURL:url placeholderImage:nil];
    self.carName.text = findModel.name;
    self.priceRange.text = findModel.priceRange;
    self.kind.text = findModel.kind;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
